package ua.org.extjsbuilder.editors;

import org.eclipse.jface.text.rules.EndOfLineRule;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.MultiLineRule;
import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
import org.eclipse.jface.text.rules.Token;

public class JSPartitionsScanner extends RuleBasedPartitionScanner {
	public final static String JS_COMMENT = "__js_comment";
	public final static String JS_KEYWORD = "__js_kw";
	
	public JSPartitionsScanner(ColorManager colorsManager) {

		IToken jsComment = new Token(JS_COMMENT);

		IPredicateRule[] pRules = new IPredicateRule[2];

		pRules[0] = new MultiLineRule("/*", "*/", jsComment);
		pRules[1] = new EndOfLineRule("//",jsComment);

		setPredicateRules(pRules);
	}
}